﻿#include "JsonFormat.h"
#include "XmlFormat.h"

int main(int argc, char ** argv)
{
    std::string strJson = "{\"project\":{\"name\":\"TextFormat\",\"repository\":\"git@gitee.com:yangjiang0217/TextFormat.git\",\"author\":{\"name\":\"yangjiang\",\"email\":\"yangjiang0217@126.com\"},\"version\":1.0.0}}";
    std::string strXml = "<?xml version=\"1.0\" encoding=\"utf-8\"?><project><name>TextFormat</name><repository>git@gitee.com:yangjiang0217/TextFormat.git</repository><author><name>yangjiang</name><email>yangjiang0217@126.com</email></author><version>1.0.0</version></project>";
    std::string strJsonFormat = JsonFormat(strJson.c_str());
    std::string strJsonCompress = JsonCompress(strJsonFormat.c_str());
    std::string strXmlFormat = XmlFormat(strXml.c_str());
    std::string strXmlCompress = XmlCompress(strXmlFormat.c_str());
    printf("JsonFormat:\n%s\n\n", strJsonFormat.c_str());
    printf("JsonCompress:\n%s\n\n", strJsonCompress.c_str());
    printf("XmlFormat:\n%s\n\n", strXmlFormat.c_str());
    printf("XmlCompress:\n%s\n\n", strXmlCompress.c_str());
    printf("press enter key to continue ...");
    getchar();
    return 0;
}
